Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulling fix/default-font-2 into develop #977

Merged
merged 24 commits into from
Feb 18, 2025
Merged

Pulling fix/default-font-2 into develop #977

merged 24 commits into from
Feb 18, 2025

Conversation

github-actions[bot]
Copy link
Contributor

No description provided.

Copy link

coderabbitai bot commented Feb 12, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.13%. Comparing base (149e831) to head (d667da4).
Report is 24 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #977   +/-   ##
========================================
  Coverage    90.12%   90.13%           
========================================
  Files          313      313           
  Lines        18810    18828   +18     
  Branches       791      797    +6     
========================================
+ Hits         16953    16971   +18     
- Misses        1854     1856    +2     
+ Partials         3        1    -2     
Files with missing lines Coverage Δ
packages/editor-toolbar/src/context/atomConfigs.ts 100.00% <100.00%> (ø)
packages/ui-dsc/src/home/AuthorizedHeading.tsx 100.00% <100.00%> (ø)
packages/ui-dsc/src/home/homeStyles.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Adds "Inter Variable" as a default font option in the
FontFamilyDropdown component and updates the FontFamily enum to
include INTER_VARIABLE. This allows users to select the Inter
Variable font in the editor.
The default font family is now Inter Variable, which improves the default
look and feel of the editor.
The editor now initializes with an empty text node to ensure
consistent behavior and prevent potential errors when the editor
starts without any content.
This commit introduces the DictybaseToolbar component, which provides a
toolbar for the editor with various formatting options. It includes
buttons for undo, redo, font size, font family, block format, bold,
italic, underline, color picker, insert link, insert table, insert
image, and upload file. The toolbar utilizes Material-UI components
and custom hooks for styling and cleanup.
This commit introduces a new package, editor-toolbar, which
exports the DictybaseToolbar component and atomConfigs context.
This toolbar will be used in the editor for dictyBase.
Adds a font selection dropdown to the editor toolbar, allowing
users to change the font of selected text.

The font selection dropdown is populated with a list of
available fonts, defined in the `fonts` array. The
`DEFAULT_FONT` constant is used to set the initial font of
the editor.

The `formatAtom` is updated to include a `fontFamily` property,
which is used to store the currently selected font.

The `isBoldAtom`, `isItalicAtom`, `isUnderlinedAtom`,
`fontSizeAtom`, `fontColorAtom`, and `blockTypeAtom` atoms are
updated to use the `focusAtom` function to derive their values
from the `formatAtom`.

The `tableActionMenuOpenAtom` and `colorPickerOpenAtom` atoms
are updated to use the `focusAtom` function to derive their
values from the `openAtom`.

This change allows users to customize the appearance of their
text by selecting a different font.
The main entrypoint was pointing to a .tsx file, but it should point to the
compiled .ts file. This change fixes the entrypoint to point to the correct
file.
The initial editor state was hardcoded to use "Inter Variable" as the font family. This commit changes the initial state to use the DEFAULT_FONT variable from the "@dictybase/editor-toolbar" package. This ensures that the editor always uses the correct default font, even if the DEFAULT_FONT variable is changed in the future.
The FontFamilyDropdown component now uses the fonts atom to populate the
dropdown options. This change centralizes the font options in a single
location, making it easier to manage and update. The
defaultFontFamilyOptions property has been removed as it is no longer
needed.
… bottom

The Inter Variable font was moved to the bottom of the font list. This change improves the user experience by prioritizing more common fonts.
Use fp-ts Option to safely handle the initial editor state.
This avoids potential errors when accessing nested properties of
the content object. The code now uses `pipe` and Option methods
like `fromNullable`, `map`, and `getOrElse` to handle cases where
`content` or `content.editorState` might be null or undefined.
This makes the code more robust and easier to reason about.
The default font-family was hardcoded to "Arial". This commit changes the default value to DEFAULT_FONT, which is defined in atomConfigs. This ensures that the default font-family is consistent throughout the application.
The title attribute was added to the Select component to improve
accessibility. This provides a descriptive label for screen readers
and other assistive technologies, making the component more
user-friendly for individuals with disabilities.
The event.target.value type was string, but it should be
FontFamily. This change ensures that the correct type is used.
…unused code

The toolbar is now conditionally rendered based on the `toolbar` and `editable` props. The `fp-ts` library is used to handle the nullable `toolbar` prop and the boolean `editable` prop. Unnecessary commented-out code and styles were removed to improve code readability.
The editor now renders an empty fragment instead of nothing when both the toolbar and editable props are null. This ensures that the editor always renders something, even if it's just an empty fragment.
The ButtonStates type definition was duplicated across multiple
packages. This type definition was not being used.
The change encapsulates internal atom configurations by making enums and
atoms private, and selectively exports only the necessary atoms for
external use. This improves modularity and prevents unintended
modifications to the internal state.
The export of the atoms was moved to the bottom of the file to improve readability.
This change adds a new class `iconButton` to the `AuthorizedHeading` component in `ui-dsc`. The new class removes the padding from the top and bottom of the icon button. This change improves the appearance of the component by making the icon button look more visually appealing.
@ktun95 ktun95 force-pushed the fix/default-font-2 branch from fcea41f to f6af4c5 Compare February 18, 2025 21:06
… FontSizes array

This commit introduces a DEFAULT_FONT_SIZE constant and removes the FontSizes array. The default font size is now defined as a constant, which improves code readability and maintainability. The FontSizes array was removed because it was not being used and was redundant.
…return objects with value and label

The font size array generation was refactored to return an array of objects, each with a `value` and a `label` property. This improves the readability and maintainability of the code, as it makes it clearer what each value in the array represents. It also makes it easier to use the array in the `MenuItem` components, as the `value` and `label` properties can be directly accessed.
The editor now has a default font size in its initial state. This ensures that the editor always starts with a consistent font size, improving the user experience.
This commit improves the font size dropdown component by adding a space between the font size value and the "px" unit in the label. It also cleans up the atom configs by removing an unnecessary empty line.
@ktun95 ktun95 merged commit 37aca11 into develop Feb 18, 2025
9 checks passed
@ktun95 ktun95 deleted the fix/default-font-2 branch February 18, 2025 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant